﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SmartProject.Entity;

using FluentNHibernate.Mapping;

namespace SmartProject.Mapping
{
    public class LogMap : ClassMap<Log>
    {
        public LogMap()
        {
            Table("SmartProject_Log");
            Id(x => x.Id).Column("LogId");
            Map(x => x.ClassName).Length(80).Not.Nullable();
            Map(x => x.MethodName).Length(100).Not.Nullable();
            Map(x => x.Description).Length(500).Not.Nullable();
            References<Severity>(x => x.Severity)
                .Column("SeverityId").Not.Nullable()
                .Cascade.None()
                .Fetch.Select();
            Map(x => x.Active).Not.Nullable();
            Map(x => x.Created).Not.Nullable();
        }
    }
}
